extension StringExtension on String {
  bool checkCNPhone() {
    String regexPhoneNumber =
        "^((13[0-9])|(15[^4])|(166)|(17[0-8])|(18[0-9])|(19[8-9])|(147,145))\\d{8}\$";
    if (isEmpty) {
      return false;
    }
    return RegExp(regexPhoneNumber).hasMatch(this);
  }

  ///判断是否是网路图片
  bool isNetworkImage() {
    return contains("https://") || contains("http://");
  }

  ///将手机号码分割为344格式
  String get334tPhone(){
     String content = this;
    if (length >= 4 && length <= 7) {
      content =
      "${substring(0, 3)} ${substring(3, length)}";
    } else if (length > 7) {
      content =
      "${substring(0, 3)} ${substring(3, 7)} ${substring(7, length)}";
    }
    return content;
  }

}
